* ASSIGNMENTS
use raw_data/2017/randomization_result_anonymous_as_used_on_20170410.dta, clear
run labels.do
encode w_f, gen(forum) label(forum)
encode w_a, gen(a_location) label(location)
encode w_s, gen(sympathy) label(sympathy)
encode judge, gen(judge) label(judge)
tempfile 2017
save `2017'

use raw_data/2018/randomization_results_as_used_2018_anonymous.dta, clear
run labels.do
rename (forum sympathy) =_
encode f, gen(forum) label(forum)
encode a, gen(a_location) label(location)
encode s, gen(sympathy) label(sympathy)
encode judge, gen(judge) label(judge)

append using `2017', gen(year)
recode year (0 = 2018) (1 = 2017)

drop *_

cap log close
log using analysis_output/tableA10_full_participation_matrix, replace text
table (year judge) (forum a_loc sympa), stat(freq) totals(forum#a_loc#sympa)
log off

* PARTICIPATIONS and DECISIONS
use forum a_location sympathy cap judge year using alldata.dta, clear
label define judge 5 "(missing)", add
recode judge (.=5)
log on
table (year judge) (forum a_loc sympa), stat(freq) stat(total cap) totals(forum#a_loc#sympa)
log close